export function toMap(array, key) {
	var map = {}
	for (var i = 0; i < array.length; i++) {
		map[array[i][key]] = array[i]
	}
	return map
}

export function toList(map) {
	var list = []
	Array.forEach(map, function (value) {
		if (value) {
			list.push(value)
		}
	})
	return list
}
